Skip to content

Complete Types::Block hash semantics - #3136

Merged
soutaro merged 2 commits into
ruby:masterfrom
OskarEichler:codex/block-hash-contract
Sep 7, 2026
Merged

Complete Types::Block hash semantics#3136
soutaro merged 2 commits into
ruby:masterfrom
OskarEichler:codex/block-hash-contract

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

RBS::Types::Block implements value equality with ==, but does not alias eql? or define a corresponding hash. Equal block types therefore behave as different Hash/Set keys, unlike the surrounding immutable type objects.

Add eql? and compute the hash from the same type, required flag, and self type used by equality.

Verification

  • baseline model reproduces the Hash-key miss; focused and cumulative candidates pass
  • type tests: 3 tests / 44 assertions
  • all 109 runtime files compile on Ruby 4.0.6
  • focused candidate syntax, RuboCop, and diff checks pass

Source-only change; no test file is included.

@soutaro soutaro self-assigned this Sep 7, 2026
@soutaro
soutaro enabled auto-merge September 7, 2026 07:57
@soutaro
soutaro added this pull request to the merge queue Sep 7, 2026
Merged via the queue into ruby:master with commit 47cab6d Sep 7, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants